package com.bidevalution.support.websocket;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.bidevalution.support.context.ChannelContext;
import com.google.common.collect.Maps;

import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;

public class WebSocketCached {
	public static Map<String, WebSocketServerHandshaker> webSocketHandshakerMap = new ConcurrentHashMap<String, WebSocketServerHandshaker>();
	private static Map<String, ChannelContext> expertChannelContextMap = new ConcurrentHashMap<String, ChannelContext>();
	public static Map<String,ChannelContext> dataMap = Maps.newHashMap();
	public static void putExpertChannelContext(String accessToken,ChannelContext channelContext) {
		dataMap.put(channelContext.getChannelHandlerContext().channel().id().asLongText(), channelContext);
		expertChannelContextMap.put(accessToken, channelContext);
	}
	public static Map<String, ChannelContext> getExpertChannelContextMap(){
		return  expertChannelContextMap;
	}
}
